<switch name="data.type">      
    <case value="single_choice">
	    <div>{$data.stem}</div>
		<div style="position:relative">
		  <img src="./Public/Examination/images/right.png" width="100" height="100" style="position:absolute;right:0px;top:-50px"/>
		</div>
	    <php>$jsonitems=json_decode($data['metas'],false);//dump($jsonitems);</php>
	    <php> //dump($jsonitems->choices);
			foreach($jsonitems->choices as $key=>$val)
			{
				//dump($key."=".$val);
				</php>
				<table width="100%"  border="0" cellspacing="0" cellpadding="0">
                    <tr>
                       <td width=30>{$az|msubstr=$key,1,'utf-8',false|strtoupper}:</td>
                       <td>{$val|base64_decode|stripslashes}</td>
                    </tr>
                </table>
				<php>
			}
		</php>
		<php> //dump($jsonitems->choices);
		$questionanswer=json_decode($answer[$data['id']],false);
			foreach($jsonitems->choices as $key=>$val)
			{
				//dump($key."=".$val);
				</php>
				<label class="radio-inline"><input type="radio" data-type="choice" name="question_{$data['id']}" 
				<php>
				if(in_array(base64_encode(strtoupper(msubstr($az,$key,1,'utf-8',false))),$questionanswer))
				{
				</php>
				 checked="checked" 
                <php>
				}
				</php>
				value="{$az|msubstr=$key,1,'utf-8',false|strtoupper}">&nbsp;{$az|msubstr=$key,1,'utf-8',false|strtoupper}</label>
				<php>
			}
		</php>
		<php>$jsonanswer=json_decode($data['answer'],true);//dump($jsonanswer);</php>
		<div style="display:none">正确答案是：
		<php> 
			foreach($jsonanswer as $key=>$val)
			{
				//dump($key."=".$val);
				</php>
				<label>{$az|msubstr=$val,1,'utf-8',false|strtoupper}</label>
				<php>
			}
		</php>
		</div>
		<br>解析:
		<div>{$data['analysis']}</div>
	</case>    
	<case value="choice">
	    <div>{$data.stem}</div>
		<div style="position:relative">
		  <img src="./Public/Examination/images/right.png" width="100" height="100" style="position:absolute;right:0px;top:-50px"/>
		</div>
	    <php>$jsonitems=json_decode($data['metas'],false);//dump($jsonitems);</php>
	    <php> //dump($jsonitems->choices);
			foreach($jsonitems->choices as $key=>$val)
			{
				//dump($key."=".$val);
				</php>
				<table width="100%"  border="0" cellspacing="0" cellpadding="0">
                    <tr>
                       <td width=30>{$az|msubstr=$key,1,'utf-8',false|strtoupper}:</td>
                       <td>{$val}</td>
                    </tr>
                </table>
				<php>
			}
		</php>
		<php> //dump($jsonitems->choices);
			foreach($jsonitems->choices as $key=>$val)
			{
				//dump($key."=".$val);
				</php>
				<label class="checkbox-inline"><input type="radio" data-type="choice" 
				<php>
				if(in_array(base64_encode(strtoupper(msubstr($az,$key,1,'utf-8',false))),$questionanswer))
				{
				</php>
				 checked="checked" 
                <php>
				}
				</php>
				name="question_{$data['id']}[]" value="{$az|msubstr=$key,1,'utf-8',false|strtoupper}">&nbsp;{$az|msubstr=$key,1,'utf-8',false|strtoupper}</label>
				<php>
			}
		</php>
		<php>$jsonanswer=json_decode($data['answer'],true);//dump($jsonanswer);</php>
		<div style="display:none">正确答案是：
		<php> 
		$questionanswer=json_decode($answer[$data['id']],false);
			foreach($jsonanswer as $key=>$val)
			{
				//dump($key."=".$val);
				</php>
				<label>{$az|msubstr=$val,1,'utf-8',false|strtoupper}</label>
				<php>
			}
		</php>
		</div>
		<br>解析:
		<div>{$data['analysis']}</div>
	</case>
	<case value="fill">
	    <php>
		    $title=$data['stem'];
			//dump($title);
		    preg_match_all('/\\[\\[.+?\\]\\]/i' ,$data['stem'] ,$res);
			//dump($res);
			$i=0;
			foreach($res[0] as $key=>$val)
            {
                $title=str_replace($val,"<span style='text-decoration:underline;color:#ff0000'>  (".++$i.")  </span>",$title);

				//$val=preg_replace('/(\\[\\[|\\]\\])/','',$val);
				//echo $val;
            }
			</php>
			<div>{$title}</div>
			<div style="position:relative">
		      <img src="./Public/Examination/images/right.png" width="100" height="100" style="position:absolute;right:0px;top:-50px"/>
		    </div>
			<php>
			//echo $title;
			$questionanswer=json_decode($answer[$data['id']],false);
			$i=0;
			foreach($res[0] as $key=>$val)
            {
                </php>
				   <div style="margin:5px 0px"><input class="form-control " type="text" data-type="fill" 
				   value="{$questionanswer[$key][0]|base64_decode}" 
				   name="question_{$data['id']}[]" placeholder="填空({++$i})答案，请填在这里"></div>
				<php>
            }
			$jsonanswer=json_decode($data['answer'],true);
			foreach($jsonanswer as $key=>$val)
			{
				//dump($key."=".stripslashes(base64_decode($val[0])));
				</php>
				   <div>填空({$key+1})： 正确答案 {$val[0]|base64_decode|stripslashes} </div>
				<php>
			}
		</php>
		<br>解析:
		<div>{$data['analysis']}</div>
	</case>
	<case value="determine">
	    <div>{$data.stem}</div>
		<div style="position:relative">
		  <img src="./Public/Examination/images/right.png" width="100" height="100" style="position:absolute;right:0px;top:-50px"/>
		</div>
	    <php>$data['metas']='{"choices":["正确","错误"],"0":"1","1":"0"}';$jsonitems=json_decode($data['metas'],false);//dump($jsonitems);</php>
	    <php> //dump($jsonitems->choices);
			foreach($jsonitems->choices as $key=>$val)
			{
				//dump($key."=".$val);
				</php>
				<php>
			}
		</php>
		<php> //dump($jsonitems->choices);
		$questionanswer=json_decode($answer[$data['id']],false);
			foreach($jsonitems->choices as $key=>$val)
			{
				//dump($key."=".$val);
				</php>
				<label class="radio-inline"><input type="radio" data-type="choice" 
				<php>
				if(in_array(base64_encode(1-$key),$questionanswer))
				{
				</php>
				 checked="checked" 
                <php>
				}
				</php> 
				name="question_{$data['id']}" value="{$jsonitems->$key}">{$val}</label>
				<php>
			}
		</php>
		<php>$jsonanswer=json_decode($data['answer'],true);//dump($jsonanswer);</php>
		<div>正确答案是：
		<php> 
			foreach($jsonanswer as $key=>$val)
			{
				//dump($key."=".$val);
				</php>
				<label>{$jsonitems->choices[$jsonitems->$val]}</label>
				<php>
			}
		</php>
		</div>
		<br>解析:
		<div>{$data['analysis']}</div>
	</case>
	<case value="essay">
	    <div>{$data.stem}</div>
		<div style="position:relative">
		  <img src="./Public/Examination/images/right.png" width="100" height="100" style="position:absolute;right:0px;top:-50px"/>
		</div>
		<div>
		<textarea class="form-control " name="question_{$data['id']}" cols="" rows="6"><php>
			 $questionanswer=json_decode($answer[$data['id']],false);
			 echo base64_decode($questionanswer[0]);
			 </php>
		</textarea>
		</div>
		<php>$jsonanswer=json_decode($data['answer'],true);//dump($jsonanswer);</php>
		<div>正确答案是：
			{$jsonanswer[0]|base64_decode|stripslashes}
		</div>
		<br>解析:
		<div>{$data['analysis']}</div>
	</case>
	<default />找不到试题类型。
</switch>